CREATE TABLE [dbo].[tb_RegistroDeLiquidacionPorAjuste]
(
[idRegistro] [int] NOT NULL IDENTITY(1, 1),
[Ajuste] [int] NOT NULL,
[RegistroLiquidacion] [int] NULL,
[Liquidacion] [int] NOT NULL,
[AgenteAjustado] [int] NOT NULL,
[Organizacion] [int] NULL,
[Servicio] [int] NULL,
[LegajoSalarial] [int] NOT NULL,
[CargoSalarial] [int] NULL,
[SituacionRevista] [int] NULL,
[Horas] [int] NULL,
[Desde] [datetime] NULL,
[Hasta] [datetime] NULL,
[Concepto] [int] NOT NULL,
[Cantidad] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Afiliacion] [int] NULL,
[Descripcion] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MontoHaberes] [float] NOT NULL,
[MontoDescuento] [float] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_RegistroDeLiquidacionPorAjuste] ADD CONSTRAINT [PK_tb_RegistroDeLiquidacionPorAjuste] PRIMARY KEY NONCLUSTERED  ([idRegistro]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_RegistroDeLiquidacionPorAjuste] WITH NOCHECK ADD CONSTRAINT [FK_tb_RegistroDeLiquidacionPorAjuste_tb_Afiliaciones] FOREIGN KEY ([Afiliacion]) REFERENCES [dbo].[tb_Afiliaciones] ([idAfiliacion])
GO
ALTER TABLE [dbo].[tb_RegistroDeLiquidacionPorAjuste] WITH NOCHECK ADD CONSTRAINT [FK_tb_RegistroDeLiquidacionPorAjuste_tb_Agentes] FOREIGN KEY ([AgenteAjustado]) REFERENCES [dbo].[tb_Agentes] ([idAgente])
GO
ALTER TABLE [dbo].[tb_RegistroDeLiquidacionPorAjuste] WITH NOCHECK ADD CONSTRAINT [FK_tb_RegistroDeLiquidacionPorAjuste_tb_Ajustes] FOREIGN KEY ([Ajuste]) REFERENCES [dbo].[tb_Ajustes] ([idAjuste])
GO
ALTER TABLE [dbo].[tb_RegistroDeLiquidacionPorAjuste] WITH NOCHECK ADD CONSTRAINT [FK_tb_RegistroDeLiquidacionPorAjuste_tb_ConceptosDeLiquidacion] FOREIGN KEY ([Concepto]) REFERENCES [dbo].[tb_ConceptosDeLiquidacion] ([idConceptoLiquidacion])
GO
ALTER TABLE [dbo].[tb_RegistroDeLiquidacionPorAjuste] WITH NOCHECK ADD CONSTRAINT [FK_tb_RegistroDeLiquidacionPorAjuste_tb_Liquidaciones] FOREIGN KEY ([Liquidacion]) REFERENCES [dbo].[tb_Liquidaciones] ([idLiquidacion])
GO
ALTER TABLE [dbo].[tb_RegistroDeLiquidacionPorAjuste] WITH NOCHECK ADD CONSTRAINT [FK_tb_RegistroDeLiquidacionPorAjuste_tb_Organizaciones] FOREIGN KEY ([Organizacion]) REFERENCES [dbo].[tb_Organizaciones] ([idOrganizaciones])
GO
ALTER TABLE [dbo].[tb_RegistroDeLiquidacionPorAjuste] WITH NOCHECK ADD CONSTRAINT [FK_tb_RegistroDeLiquidacionPorAjuste_tb_RegistroDeLiquidaciones] FOREIGN KEY ([RegistroLiquidacion]) REFERENCES [dbo].[tb_RegistroDeLiquidaciones] ([idRegistroLiquidacion])
GO
